<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2014/10/8
  Time: 10:28
--%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page import="photobox.account.PublicizeImg" contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <meta name="renderer" content="webkit|ie-comp|ie-stand" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <title>99图藏-全球首家摄影艺术品交易市场</title>

    <link rel="stylesheet" href="${resource(dir: '/photobox', file: 'bootstrap3.3.min.css')}" type="text/css">
    <link rel="stylesheet" href="${resource(dir: '/photobox', file: 'bootstrap-theme3.3.min.css')}" type="text/css">
    <script type="text/javascript" src="${resource(dir:'/assets/js',file:'jquery-1.11.0.js')}"></script>
    <script type="text/javascript" src="${resource(dir:'/photobox',file:'bootstrap3.3.min.js')}"></script>

    <script type="text/javascript" src="${resource(dir:'/photobox',file:'alert.js')}"></script>

    <link rel="stylesheet" href="${resource(dir:'/photobox',file:'PBcss.css')}" type="text/css"/>
    <script>
        var ajaxNews = function(){
            $.ajax({
                type:"POST",
                url:"<g:createLink controller='member' action='readStatus'/>",
                data:{json:1},
                dataType:'json',
                success:function(data){
                    if(data.noRead){

                        $("#noRead").html('●');
                        //alert("有未读信息");
                    }
                },
                error: function (data, status, e)//服务器响应失败处理函数
                {
                   // alert(e);
                }
            });
        }
        $(document).ready(function(){
            ajaxNews();                //加红点
            $("#quit").click(function(){
                $.ajax({
                    type:"POST",
                    url:"<g:createLink controller='member' action='signQuit'/>",
                    data:{json:1},
                    dataType:'json',
                    success:function(data){
                        sAlert(data.quitMessage);
                        window.setTimeout("window.location.reload()",3000);
                        //window.location.reload();

                    },
                    error: function (data, status, e)//服务器响应失败处理函数
                    {
                        // alert(e);
                    }
                });
            })
        });


    </script>
</head>

    %{--头部--}%
    <div class="head_bg">
    <div class="head_t">
        <div id="grailsLogo" role="banner" class="f_l">

            <a href="${domain_name}" target="_blank">
                <img src="${resource(dir: '/assets/img', file: 'logo.png')}" alt="photobox" width="145" height="75">
            </a>
        </div>
        <div class="search f_r">
            <div class="search_bor">

                    <g:form controller="photo" action="searchByStation">
                        <div class="searchL"></div>
                        <g:textField  name="searchKey" id="key" class="sear_t" placeholder="按名称查找相关作品" value="${searchKey}" />
                        <g:submitButton name="searchBtn" class="sear_btn" value=" "/>
                        <div class="searchR"></div>
                    </g:form>
                    <g:link controller="mngHome" action="login"  target="_blank"> <div style="width:280px; height: 25px;"></div></g:link>

            </div>
        </div>
        <div style="margin-right: 500px;position: relative;margin-top: 20px;" class="f_r">
            <ul class="nav nav-pills" style="width:470px;">
                <li role="presentation" class="active"><a href="http://115.28.72.130:3080/photobox/">首页</a></li>
                <li role="presentation"><a href="http://115.28.72.130/school/" target="_blank">图藏学院</a></li>
                <li role="presentation"><a href="http://115.28.72.130/school/?page_id=23" target="_blank">图Show</a></li>
                <li role="presentation"><a href="http://115.28.72.130/hualang/" target="_blank">画廊</a></li>
                <li role="presentation"><a href="http://115.28.72.130/lietou/" target="_blank">猎头</a></li>
                <li role="presentation"><a href="http://115.28.72.130/kala/" target="_blank">图卡拉</a></li>
            </ul>
        </div>
        <div class="user_rukou f_r">
            <g:if test="${session.userId==null}">
                <a href="#" class="deng" id="example">登录</a>
                <g:link controller="member" action="register">
                    注册</g:link>
            </g:if>

            <!--登录后--个人头像-->
            <g:if test="${session.userId}">
                <div class="navUser f_r">
                    <li class="dropdown">
                        <g:if test="${photobox.account.User.get(session.userId)?.photoImage}">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="${domain_name}${photobox.account.User.get(session.userId)?.photoImage}" width="56" height="56" class="userPic" /></a>
                        </g:if>
                        <g:else>
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><img src="${resource(dir: '/assets/img', file: 'headp_140.jpg')}" alt="photobox" class="userPic"></a>
                        </g:else>
                        <div class="tishi1" id="noRead"></div>
                        <!--隐藏盒子-->

                        %{--<div class="dropdown-menu user_mbg"></div>--}%
                        <ul class="dropdown-menu user_boxhide">
                            <li><g:link controller="member" action="personCenter" style="border-top:none;"><span class="tubiao6 tubiao6_1">&nbsp;</span>个人中心</g:link></li>
                            <li><g:link controller="member" action="personal"><span class="tubiao6 tubiao6_2">&nbsp;</span>帐号设置</g:link></li>
                            <li><g:link controller="member" action="news"><span class="tubiao6 tubiao6_3">&nbsp;</span>消息通知</g:link></li>
                            <g:if test="${photobox.account.User.get(session.userId).isPhotographer == 0 }">
                                <li onclick="apply();"><a href="javascript:;"><span class="tubiao6 tubiao6_5">&nbsp;</span>申请摄影师</a></li>
                            </g:if>
                            <li id="quit"><a href="javascript:;"><span class="tubiao6 tubiao6_4" >&nbsp;</span>退出</a></li>
                        </ul>
                        <!--/隐藏盒子-->
                    </li>
                </div>
                <script> $('.dropdown-toggle').dropdown() </script>
            </g:if>
        </div>

         <script >
            function apply(){
                var result = confirm("是否申请摄影师？");
                var url = "<g:createLink controller='member' action='applyPhotographer'/>";
                if(result){
                    $.post(url,{},function(data){
                           alert(data.message);
                    },'JSON');
                }
            }
        </script>
            <!--/登录后--个人头像-->

        </div>
    </div>
    %{--<div style="height: 90px;"></div>--}%
    %{--/头部--}%

